@extends('huweize.layouts.userHome')
@section('title','作家咨询-阅文作家专区')
@section('main')

    <div class="col-md-12 talkHeader">
        <h3>作家咨询</h3>
    </div>
    <div class="col-md-12 talkYear">
            <a href="{{url('huweize/home/userTalk/delall/'.session('writerid'))}}" class="btn btn-info seek" style="margin-top: 2px;float:left">
                清空消息
            </a>
            <a href="" class="btn btn-info seek" data-toggle="modal" data-target="#box_talk" style="margin-top:2px;">
                <span class="glyphicon glyphicon-comment"></span>
                新咨询
            </a>
        </span>
    </div>
    @if(count($talks))
        <div class="msgListWrap">
            {{--消息例表--}}
            <ul id="consultList">
                @foreach($talks as $k)
                    <li data-msgid="1848127">
                        <div class="msgText">
                            <p>
                                <em>{{date('Y-m-d H:i:s',$k->addtime)}}</em>
                                <span>
                                @if($k->type == 1)
                                        新书审核问题咨询
                                    @elseif($k->type == 2)
                                        作品日常管理咨询
                                    @elseif($k->type == 3)
                                        作品违规屏蔽、删除问题咨询
                                    @endif
                            </span>
                            </p><div class="reply-content">
                                <p class="btn fr">
                                    <a data-node="deleteBtn" data-msgid="1848127" href="{{url('home/userTalk/'.$k->id)}}" class="btn btn-info">删除</a>
                                </p>
                                <p class="default">{{$k->text}}</p>
                            </div>
                        </div>
                        @endforeach
                    </li>
            </ul>
        </div>
    @else
        <div class="col-md-12 talkWrap">
            <div class="talk-box">
                <p>
                    <img src="{{asset('/home/image/nomessages.png')}}" alt="">
                </p>
                <span>暂无消息</span>
            </div>
        </div>
    @endif
@endsection



<div id="box_talk" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="box_talk_Header">
                新咨询
            </div>
            <div class="box_talk_bg">
                <div class="box_talk_content">
                    <form action="{{url('huweize/home/userTalk/lll/'.$id)}}" method="post">
                        {{csrf_field()}}
                        <p>问题出处</p>
                        <h4>人生书屋</h4>
                        <p>问题分类</p>
                        <select name="type" id="">
                            <option value="1">新书审核问题咨询</option>
                            <option value="2">作品日常管理问题咨询</option>
                            <option value="3">作品违规屏蔽、删除问题咨询</option>
                        </select>
                        <p>问题描述</p>
                        @if(count($errors))
                        <script>
                            alert('{!! $errors->first('text') !!}');
                        </script>
                        @endif
                        <textarea name="text" id="" cols="30" rows="6" style="resize: none"></textarea>
                        <input type="submit" value="提交" class="btn btn-info talk_submit">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
